package com.excellent.mvvm.utils

import java.util.regex.Matcher
import java.util.regex.Pattern

/**
 * 字符格式化工具
 */
object FormatUtils {
    fun isNumeric(str: String?): Boolean {
        if (str.isNullOrEmpty()) return false
        val pattern = Pattern.compile("^(\\-|\\+)?\\d+(\\.\\d+)?\$")
        val isNum: Matcher = pattern.matcher(str)
        return isNum.matches()
    }
}